package com.hwua.service;

import com.hwua.entity.Product;
import com.hwua.entity.ProductExtend;
import com.hwua.entity.ShopCart;

import java.sql.SQLException;
import java.util.List;

public interface IShopCartService {
    /**
     * 添加购物车
     * @param shopCart
     * @return
     * @throws Exception
     */
    public int insertShoItem(ShopCart shopCart) throws Exception;

    /**
     * 根据用户id去搜索购物车内的信息
     * @param uid
     * @return
     * @throws Exception
     */
    public List<ProductExtend> queryShopCartByuid(int uid) throws Exception;

    /**
     * 根据商品id删除购物车中的商品
     * @param id
     * @return
     * @throws Exception
     */
    public int delShopCart(int id) throws Exception;

    /**
     * 根据商品pid查询
     */
    public List<ShopCart> queryShopCartBypid(int pid) throws SQLException;

    int updateShoItem(ShopCart shopCart) throws SQLException;
}
